package com.example.teach.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.teach.entity.Comment;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface CommentMapper extends BaseMapper<Comment> {
    @Delete("delete from comment where parent_id=#{contentId}")
    void deleteByParentId(Integer contentId);

    @Select("select parent_id from comment where id=#{contentId}")
    Integer selectByParentId(Integer contentId);
}
